package com.example.servletdemo.mvc.controller;

import org.springframework.web.bind.annotation.*;

/**
 * 注解RequestParam与PathVariable的使用
 * @RequestParam
 */
@RestController
public class Test2Controller {

    @RequestMapping("/getTestName")
    public String getTestName(@RequestParam(required = true) String name){
        return "my name is："+name;
    }

    @RequestMapping("/getTestName2/{name}")
    public String getTestName2(@PathVariable String name){
        return "my name is："+name;
    }
}
